home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet multimedia
/
Linux LiveCD
/
GeeXboX 1.0 EN
/
geexbox-1.0-en.i386.iso
/
GEEXBOX
/
etc
/
init.d
/
10_eject
next >
Wrap
Text File
|
2006-06-21
|
886b
|
34 lines
#!/bin/sh
#
# eject CD if booted from cdrom and their is no media files on it
#
# runlevels: geexbox, debug
if test -n "$CDROM"; then
echo "### Eject CDROM ###"
(
# add recognized files extension to the EXTS list
for i in `cat /etc/file_ext`; do
if [ -z "$EXTS" ]; then
EXTS="$i"
else
EXTS="$EXTS\|$i"
fi
done
# add recognized images extension to the EXTS list
if [ -x /usr/bin/fbi -a -e /dev/fb0 ]; then
for i in `cat /etc/img_ext`; do EXTS="$EXTS\|$i"; done
fi
# add recognized playlists extension to the EXTS list
for i in `cat /etc/list_ext`; do EXTS="$EXTS\|$i"; done
# check if their is recognized media files on the CD
if [ -z "`find "$CDROM" | grep -v /GEEXBOX/ | grep -i "\.\($EXTS\)\$"`" ]; then
# eject the CD (except when started with make exec)
[ -e /dev/cdrom -a ! -f /EXEC ] && eject
fi
)&
fi
exit 0